# -*- coding: utf-8 -*-
def readp():
    f = open("prime.txt")
    l = f.readlines()
    f.close

    result = []
    for stra in l:
        a = stra.split(' ')
        result = map(int,a)
    return result

def getn(n):
    ret = []
    for x in primes:
        if x < n:
            ret.append(x)
        else:
            break
    return ret

primes = readp()


def pasika(n):
    psk = [1]
    x = 0
    print psk
    setall = set()
    while x < n:
        x += 1
        lenp = len(psk)
        if lenp < 2:
            psk.append(1)
            sets = set(psk)
##            print psk,x
            continue
        temp = [1]
        for x in xrange(lenp -1  ):
            temp.append(psk[x]+ psk[x+1])
        temp.append(1)
        psk = temp
##        print psk,x
        setall = setall | set(psk)

##    print setall,len(setall)
    return setall

def divp(n,pn):
    for p in pn:
        pp = p*p
        if n % pp == 0:
            return 0
    return 1
def main():
    n = 51 - 3
    pasikanumber = pasika(n)
    listpasik = list(pasikanumber)
##    print listpasik
    pn = getn(listpasik[-1])
##    print pn

    listsum = []
    for psk in listpasik:
        if divp(psk,pn):
            listsum.append(psk)

    print listsum
    print
    print sum(listsum)

if __name__ == '__main__':
    import time
    start = time.time()
    main()
    print('Execution time: {0} seconds'.format(time.time() - start))
